#pragma once

#include <hash_map>

class User;

typedef stdext::hash_map<DWORD, User*>		USER_MAP;
typedef USER_MAP::iterator					USER_MAP_ITER;
typedef std::pair<DWORD, User*>				USER_MAP_PAIR;

class Zone
{
public:
	Zone(void);
	~Zone(void);

	VOID					Init();
	VOID					Release();

	BOOL					AddUser( DWORD dwGuid, User *pUser );
	VOID					AddSectorUser( DWORD dwGuid, User *pUser );
	BOOL					RemoveUser( DWORD dwGuid );
	VOID					RemoveSectorUser( DWORD dwGuid );

	VOID					SendToAll( BYTE *pMsg, WORD wSize );

	inline VOID				SetZoneType( eZONETYPE type ) { m_zoneType = type; }
	inline eZONETYPE		GetZoneType() { return m_zoneType; }
	inline VOID				SetKey( DWORD key ) { m_dwKey = key; }
	inline DWORD			GetKey() { return m_dwKey; }
	inline DWORD			GetNumberOfUsers() { return (DWORD)m_mapUsers.size(); }
	
private:
	USER_MAP				m_mapUsers;
	eZONETYPE				m_zoneType;
	DWORD					m_dwKey;
};
